Repository navigation
Fix the throws report for the failing lazy ghost fixture - #92
Merged
Merged
Conversation
Xdebug 3.5.3 caches the stack of each exception by object address and does not clear it when the exception is freed. A later exception allocated at the same address is then reported with the earlier stack. Whether the address is reused depends on the allocator, so local runs credited all four throws of the failing lazy ghost to Lens->get, while CI credits one of them, correctly, to property_is_initialized(). The fixture now keeps every exception it throws, so no two share an address, and the allowlist lists the real call sites.
|
Caution Review failedThe pull request is closed. Walkthrough
Merge Risk:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Throws workflow fails on main since #91. It credits one of the four throws from the failing lazy ghost to
property_is_initialized()atObjectEncoder.php:90, whileallowed-throws.phpexpects all four viaLens->get.CI is right. Xdebug 3.5.3 caches an exception's stack by object address and keeps that entry after the exception is freed. Both catch sites drop the exception immediately, so the next one can land on the same address and get printed with the old stack. On the runner that passed in October (ubuntu-24.04, PHP 8.4.26) and on a local Debian image the address gets reused. On ubuntu-26.04 with PHP 8.4.28 it does not.
The fixture now keeps every exception it throws alive, so the attribution no longer depends on the allocator, and the allowlist lists 3 throws via
Lens->getand 1 viaproperty_is_initialized().The same Xdebug behaviour can misattribute other throws whose exception reuses a freed address. Totals stay right, and I found no way to turn the cache off from userland.
Summary by CodeRabbit